import request from "./request";

// 获取数据中心列表
export const getDataCeneterList = async () => {
  const res = await request({
    url: '/company/business/server',
    method: 'get'
  });

  return res;
};

// 新增数据中心
export const addDataCenter = async ({
  business_id,
  city_id,
  server_name,
  description,
  max_bandwidth,
  mapping_id
}) => {
  const res = await request({
    url: '/company/business/server',
    method: 'post',
    data: {
      business_id,
      city_id,
      server_name,
      description,
      max_bandwidth,
      mapping_id
    }
  });

  return res;
};

// 编辑数据中心
export const editDataCenterApi = async ({
  business_server_id,
  city_id,
  server_name,
  description,
  max_bandwidth,
  mapping_id
}) => {
  const res = await request({
    url: '/company/business/server',
    method: 'put',
    data: {
      business_server_id,
      city_id,
      server_name,
      description,
      max_bandwidth,
      mapping_id
    }
  });

  return res;
};